#if !defined(AFX_GLOBAL_H__3845C200_B6F2_4A46_B75E_9B4891720B3A__INCLUDED_)
#define AFX_GLOBAL_H__3845C200_B6F2_4A46_B75E_9B4891720B3A__INCLUDED_

#include "stdafx.h"
#include <afx.h>
#include <afxtempl.h>
#include "pcap.h"
#include "zlib.h"
#include "assert.h"

// Threads
extern DWORD  dwCaptureThread;
extern HANDLE hCaptureThread;

// Strings
extern const char* TIMEFORMAT;

// Variables
extern int g_nNumberOfPackets;

// Constants
extern const int CHUNK;

// Structs
struct PACKET {
  bool    bIncludeInListBox;
  int     nPacketNo;
  int     nPacketLen;
  CTime   tPacketTime;
  int     nSourcePort;
  CString strPacketType;
  u_char  strPacketData[10000];
};

// Character Formats
extern CHARFORMAT cfNormal;

// Lists
extern CList <PACKET, PACKET&> PacketList;

// WinPCap variables
extern pcap_t *fp;

// Functions
const u_char* strnstr(const u_char* strHaystack, const u_char* strNeedle, int nLen);
u_char* CopyBuffer(u_char* strDest, const u_char* strSrc, int nBytesToCopy);
void ClearPacketList();
int Decompress(const u_char* strStreamIn, int nStreamInLen, u_char* strStreamOut);
PACKET FindRelatedPacket(int nSourcePort);
int GetKeyData(const char* key, const u_char* data, int len);

#endif //AFX_GLOBAL_H__3845C200_B6F2_4A46_B75E_9B4891720B3A__INCLUDED_